package com.jyh.zuoye;

import com.jyh.domain.Worker;

import java.util.Scanner;

public class TestWorker {
    public static void main(String[] args) {
        System.out.println("请录入工人姓名：");
        String name = new Scanner(System.in).nextLine();
        System.out.println("请录入工人工龄：");
        int year = new Scanner(System.in).nextInt();
        new Worker(name,year);
        //输出信息
        System.out.println("该工人对象的属性信息如下：");
        System.out.println("姓名："+name);
        System.out.println("工龄："+year);

    }
}
